﻿
<input type="hidden" id="article_type" value="${article.type}">
<div class="page_path"><div class="name"><a href="/page/articleList${article.type}">${article.typeName}</a></div>
	<span>您当前所在位置：<a href="/page/index">首页</a> > <a href="/page/articleList${article.type}">${article.typeName}</a></span>
</div>
<div class="article_title">${article.title}</div>
<div class="article_time"><span>发布人：${article.createUser}</span>|<span>发布时间：${article.createTime}</span></div>
<div class="article_txt">${article.content}</div>


<script type="text/javascript">
	// window.onload = function() {
	// 	// 回显附件 TODO
	// 	// var docFiles = $("#file").val();
	// 	let filelist = "${article.file}".split(",")
	// 	filelist.shift()
	// 	filelist.forEach(e => {
	// 		$("#showfiles").append('<p><a href='+${ctxPath}e+' target="_blank">'+e+'</a></p>');
	// 	})
	// };
    $(document).ready(function(){
        // 调整页面图片显示， 图片宽度大于750按750显示
        $(".article_txt img").each(function(i, element){
            if(element.naturalWidth>750 || element.clientWidth>750 || element.naturalWidth==0){
                console.log("=======" + element.naturalWidth);
                element.width = 750;
            }else {
                console.log("=======clientWidth" + element.clientWidth);
                console.log("=======naturalWidth" + element.naturalWidth);
                console.log("=======offsetWidth" + element.offsetWidth);
                console.log("=======scrollWidth" + element.scrollWidth);
                console.log("=======width" + element.width);
            }
        });
        // 由于文章内容，在main不能直接获取文章所属类型，所以在这里做导航选中样式
        $("#articleList"+$("#article_type").val()).addClass("active");
        console.log('111111111111111111111111111')
    });

</script>